package com.maxmlr.music.system.service;

import com.maxmlr.music.system.entity.Files;
import com.maxmlr.music.common.base.BaseService;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;

/**
 * @author max
 * @version 1.0
 * @ClassName FilesService
 * @Description 文件上传  服务类
 * @Copyright Copyright (c) 2020: www.maxmlr.com.
 * @since 2020-06-14
 */
public interface FilesService extends BaseService<Files> {

    Files upload(MultipartFile file);

    <T> T getFileById(T model, Function<T, Integer> idMapper, BiConsumer<T, String> urlMapper);

    <T> Collection<T> getFilesByIds(Collection<T> models, Function<T, Integer> idMapper,
                                    BiConsumer<T, String> urlMapper);


}
